package com.landleaf.smarthome.util.rxutils;

import android.view.View;

import com.jakewharton.rxbinding2.view.RxView;

import java.util.concurrent.TimeUnit;

import io.reactivex.Observable;

/**
 * When I wrote this, only God and I understood what I was doing
 * Now, God only knows
 * Created by 海航
 * 2019/10/9
 * 功能描述:
 */
public class RxBindUtils {
    public static Observable rxClick(View view) {
        return RxView.clicks(view)
                .throttleFirst(200, TimeUnit.MILLISECONDS);
    }

    public static Observable rxClick(View view, long time) {
        return RxView.clicks(view)
                .throttleFirst(time, TimeUnit.MILLISECONDS);
    }
}
